import requests
import json
if __name__== "__main__":
    headers={
        'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0'  
    }
    url='https://movie.douban.com/j/chart/top_list'
    params={
        'type':'25',
        'interval_id':'100:90',
        'start':'0',
        'limit':'20'
    }    
    response=requests.get(url=url,params=params,headers=headers)
    lis=response.json()

    with open('.\爬取的文档\豆瓣.json','w',encoding='utf-8') as fp:
        json.dump(lis,fp,ensure_ascii=False,indent=4)
    print(type(lis))